package com.henghong.risk.controller;

import com.henghong.risk.entity.A01M002Section;
import com.henghong.risk.result.Result;
import com.henghong.risk.service.MenuMasterService;
import com.henghong.risk.vo.MenuMasterVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/menu")
@Slf4j
@Api(tags = "菜单管理")
public class MenuMasterController {

    @Autowired
    private MenuMasterService menuMasterService;

    @GetMapping("/pageLoad")
    @ApiOperation(value = "菜单画面信息取得")
    public Result<MenuMasterVo> pageLoad() {
        log.info("开始获得対象案件一覧信息");
        MenuMasterVo menuMasterVo = menuMasterService.ankenInfo();
        return Result.success(menuMasterVo);
    }

    // 部門ドロップダウンリスト取得
    @GetMapping("/selectedIndexChanged")
    @ApiOperation(value = "部門ドロップダウンリスト取得")
    public Result<List<A01M002Section>> selectedIndexChanged(String ddlPjBranch) {
        log.info("開始取得部門ドロップダウンリスト");
        List<A01M002Section> ddlPjBranchList = menuMasterService.selectedIndexChanged(ddlPjBranch);
        return Result.success(ddlPjBranchList);
    }


}
